{include file=member.header.html}
<!-- 内容 -->
<div class="content f-cb">

  <!-- 当前位置 -->
  {include file=path.html}
  <!-- 内容左边栏 -->
  {include file=member.menu.html}
  <!-- 内容右边栏 -->
  <script type="text/javascript">
    /*$(function(){
      $('#datefrom').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true,changeYear: true});
      $('#dateto').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true,changeYear: true});
    });*/
	
	function confirm_clearing()
	{
		var is_btn = window.confirm('您确定要确认可结算吗？');
		if(!is_btn){return false;}
		location.href='index.php?app=my_clearing&act=confirm';
	}
    </script>
  <div class="con-shop-r">
    <ul class="receive-t f-cb">
      <li>
        <a href="index.php?app=my_clearing" class="current" >本期结算</a>
      </li>
      <li>
        <a href="index.php?app=my_clearing&act=record" >历史结算</a>
      </li>
    </ul>
    <div>
      <dl class="tradentes-template my_clearing">
        <dd>
        <!--{if $clearing_status eq 1 and !$is_tclearing_date}-->
        <div class="member_no_records">亲,请在结算期内进行核对结算,每月的10号至15号为结算期<br/>如果过了结算期限就到下个月结算期进行结算!</div>
        <!--{else}-->
          <form action="" method="get" class="">
            <!--{if $orders}-->
            <table width="100%">
              <tr>
              <td align="right" >
                    <input type="button" class="subbtnhs" value="导出" onclick="location.href='index.php?app=my_clearing&export=1'" align="texttop"/>
                </td>
              </tr>
            </table>
            <!--{/if}-->
            <input type="hidden" value="my_clearing" name="app">
            <div class="tradentes-p-d">
              <table width="100%">
                <tr>
                  <th>交易时间</th>
                  <th>网上订单号</th>
                   <th>买方</th>
                  <th>买方所在城市</th>
                  <th>商品名称</th>
                  <th>商品数量</th>
                  <th>商品单价</th>
                  <th>退货金额</th>
                  <th>物流费用</th>
                  <th>订单交易金额</th>
                  <th>服务费金额</th>
                  <th>其他费用</th>
                  <th>商家结算金额</th>
              </tr>

              <!-- 循环开始 -->
              <!--{if $orders}-->
              <!--{foreach from=$orders item=order name=order}-->
                <!--{foreach from=$order.goods item=goods  name=goods}-->
                  <tr>
                    <td>{$order.pay_time|date}</td>
                    <td>{$order.order_sn|escape}</td>
                    <td>{$goods.buyer_name|escape}</td> 
                    <td>{$goods.buyer_city|escape}</td>  
                    <td width="120">{$goods.goods_name|escape}</td>  
                    <td>{$goods.goods_quantity}</td>  
                    <td>{$goods.goods_price}</td> 
                    <td>{$goods.returns_amount}</td>
                    <!--{if $smarty.foreach.goods.iteration eq 1}-->
                    <td rowspan="{$order.goods_count}">{$order.shipping_fee}</td> 
                    <td rowspan="{$order.goods_count}">{$order.deal_amount}</td>
                    <td rowspan="{$order.goods_count}">{$order.service_fee_sum}</td>
                    <td rowspan="{$order.goods_count}">{$order.other_fee}</td>
                    <td rowspan="{$order.goods_count}">{$order.store_account_amount}</td>
                    <!--{/if}-->              
                </tr>
               <!--{/foreach}-->
           <!--{/foreach}--> 
              <tr class="total">
                <td>{$total.pay_time}</td>
                <td>{$total.order_sn|escape}</td>
                <td>&nbsp;</td> 
                <td>&nbsp;</td>  
                <td>&nbsp;</td>  
                <td>{$total.goods_quantity}</td>  
                <td>&nbsp;</td> 
                <td>{$total.returns_amount}</td> 
                <td>{$total.shipping_fee}</td>
                <td>{$total.deal_amount}</td>
                <td>{$total.service_fee_sum}</td>
                <td>{$total.other_fee}</td>
                <td>{$total.store_account_amount}</td>
            </tr>
            <!--{else}-->
            <tr>
              <td colspan="13">{$lang.no_records}</td>
            </tr>
            <!--{/if}-->
            </table>
          <!--{if $orders}-->
          <!--{if $clearing_status eq 1}--><div style="padding:20px 0px 0px 20px;"><input type="button" class="subbtnhs" value="确认可结算" onclick="javascript:confirm_clearing();" align="texttop"/></div><!--{/if}-->
          <div class="goods-page">{include file=goods.page.bottom.html}</div>
          <!--{/if}--> </div>
      </form>
       <!--{/if}-->
    </dd>
  </dl>
</div>
</div>
</div>
<!-- 页脚 -->
{include file=footer.html}